package avicit.bdp.dds.api.dto;

import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * 目录对象
 */
public class CatalogDto {

    @ApiModelProperty(value = "目录id")
    private String id;

    @ApiModelProperty(value = "目录名称")
    private String catalogName;

    @ApiModelProperty(value = "目录路径")
    private String catalogPath;

    @ApiModelProperty(value = "父目录路径")
    private String parentCatalogPath;

    @ApiModelProperty(value = "是否最底层目录")
    private boolean lastestCatalog;

    @ApiModelProperty(value = "children")
    private List<CatalogDto> children;

    @ApiModelProperty(value = "目录标识")
    private boolean isDirectory;

    public CatalogDto(Builder builder) {
        this.id = builder.id;
        this.catalogName = builder.catalogName;
        this.catalogPath = builder.catalogPath;
        this.parentCatalogPath = builder.parentCatalogPath;
        this.lastestCatalog = builder.lastestCatalog;
        this.children = builder.children;
        this.isDirectory = builder.isDirectory;
    }

    public CatalogDto() {

    }

    public static Builder builder() {
        return new Builder();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCatalogName() {
        return catalogName;
    }

    public void setCatalogName(String catalogName) {
        this.catalogName = catalogName;
    }

    public String getCatalogPath() {
        return catalogPath;
    }

    public void setCatalogPath(String catalogPath) {
        this.catalogPath = catalogPath;
    }

    public List<CatalogDto> getChildren() {
        return children;
    }

    public void setChildren(List<CatalogDto> children) {
        this.children = children;
    }

    public String getParentCatalogPath() {
        return parentCatalogPath;
    }

    public boolean isLastestCatalog() {
        return lastestCatalog;
    }

    public void setLastestCatalog(boolean lastestCatalog) {
        this.lastestCatalog = lastestCatalog;
    }

    public void setParentCatalogPath(String parentCatalogPath) {
        this.parentCatalogPath = parentCatalogPath;
    }

    public boolean isDirectory() {
        return isDirectory;
    }

    public void setDirectory(boolean directory) {
        isDirectory = directory;
    }

    public static final class Builder {
        private String id;

        private String catalogName;

        private String catalogPath;

        private String parentCatalogPath;

        private boolean lastestCatalog;

        private List<CatalogDto> children;

        public boolean isDirectory;

        public Builder id(String id) {
            this.id = id;
            return this;
        }
        public Builder catalogName(String catalogName) {
            this.catalogName = catalogName;
            return this;
        }
        public Builder catalogPath(String catalogPath) {
            this.catalogPath = catalogPath;
            return this;
        }
        public Builder parentCatalogPath(String parentCatalogPath) {
            this.parentCatalogPath = parentCatalogPath;
            return this;
        }
        public Builder lastestCatalog(boolean lastestCatalog) {
            this.lastestCatalog = lastestCatalog;
            return this;
        }
        public Builder children(List<CatalogDto> children) {
            this.children = children;
            return this;
        }
        public Builder isDirectory(boolean isDirectory) {
            this.isDirectory = isDirectory;
            return this;
        }
        public CatalogDto build() {
            return new CatalogDto(this);
        }

    }
}
